<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>翻转数组</title>
	</head>
	<body>
		<script>
			var arr=[];
			while(true){
				var num=parseInt(prompt("请输入数组"));
				arr.push(num);
				var choice=prompt("是否继续输入,结束输入no");
				if(choice=='no'){
					break;
				}
			}
			function turn(arr){
				var newArr=[];
				for(var i=0;i<arr.length;i++){
					newArr[newArr.length]=arr[arr.length-i-1];
				}
				return newArr;
			}
			console.log(turn(arr))
		</script>
	</body>
</html>
